from flask import Flask, jsonify
from flask_cors import CORS

app = Flask(__name__)
CORS(app)

@app.route('/api/cities', methods=['GET'])
def get_cities():
    cities = [
        '北京', '上海', '广州', '深圳', '南京', '杭州',
        '成都', '武汉', '西安', '重庆', '天津', '苏州'
    ]
    return jsonify({
        'success': True,
        'cities': cities
    })

@app.route('/api/test', methods=['GET'])
def test():
    return jsonify({
        'success': True,
        'message': '后端服务正常运行！'
    })

if __name__ == '__main__':
    print("启动简化版后端服务...")
    print("服务地址: http://localhost:5000")
    app.run(debug=True, host='0.0.0.0', port=5000)